package com.matrix.java.chap_05.example;

import java.util.Scanner;

public class Case5_01 {
    public static void main(String[] args) {

        int num1 = (int) (Math.random() * 10);
        int num2 = (int) (Math.random() * 10);
        int sum = num1 + num2;
        System.out.println(sum);
        Scanner input = new Scanner(System.in);
        System.out.print("input: ");
        int guessNum = input.nextInt();
        while (sum != guessNum) {
            System.out.print("wrong!again: ");
            guessNum = input.nextInt();

        }
        System.out.println("correct!");
        input.close();

    }
}
